<extend name="./Public/layout/default.html"/>

<block name="top">
    <div class="nva">
        <ul class="el-menu el-menu--horizontal el-menu--dark">
            <a href="{:U('/Admin/main')}"><li class="el-menu-item">主页</li></a>
            <li class="dropdown el-menu-item"><a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                                    aria-expanded="false"><span class="creat-font" style=" color: white;display: inline-block;height: 70px;line-height: 70px;padding: 0">商品管理</span> <span
                    class="caret"></span></a>
                <ul class="dropdown-menu" id="new"  style="width: 300px">
                    <li><a data-toggle="modal" data-target="#d1" class="font"><span>添加普通商品</span></a></li>
                    <li role="separator" class="divider"></li>
                    <li><a data-toggle="modal" data-target="#d2" class="font"><span>添加特价商品</span></a></li>
                    <li role="separator" class="divider"></li>
                    <li><a data-toggle="modal" data-target="#b4" class="font"><span>添加商品类型</span></a></li>
                </ul>
            </li>
            <!--<a href="{:U('/Admin/main')}"><li class="el-menu-item">客户管理</li></a>-->
            <a href="{:U('/Admin/Emtpy/index')}"><li class="el-menu-item">退出登录</li></a>
        </ul>
    </div>
</block>

<block name="title">所有商品</block>



<block name="content">
    <table class="table">
        <tr>
            <th>商品名字</th>
            <th>商品图片</th>
            <th>价格</th>
            <th>折扣</th>
            <th>数量</th>
            <th>类型</th>
            <th>&nbsp;</th>
        </tr>
        <foreach name="shop" item="shops">
            <tr>
                <td>{$shops.shopname}</td>
                <td><img class="imgsid" src="/Public/imgs{$shops.shopimg}" alt=""></td>
                <td>{$shops.price}</td>
                <if condition="$shops.discount eq 1">
                    <td>{$shops.discount}</td>
                    <td>{$shops.number}</td>
                    <td>{$shops.leibiename}</td>
                    <td>&nbsp;</td>
                    <td><a href="{:U('/Admin/Record')}?id={$shops.idit}">删除商品</a></td>
                <else />
                    <td>{$shops.discount}</td>
                    <td>{$shops.number}</td>
                    <td>{$shops.leibiename}</td>
                    <td><a data-toggle="modal" data-target="#A{$shops.idit}" class="font">修改折扣</a></td>
                    <td><a href="{:U('/Admin/Record')}?id={$shops.idit}">删除商品</a></td>
                </if>
            </tr>
        </foreach>
    </table>
</block>




<block name="modal">
    <div class="modal" id="d1">
        <div class="modal-dialog" style="width:420px;">
            <div class="modal-content">
                <div class="modal-header">
                    <h4>添加普通商品</h4>
                </div>
                <form action="__URL__/update" method="post" class="form-horizontal" enctype="multipart/form-data">
                    商品：<input type="text" name="shopname"><br><br>
                    图片：<input type="file" name="shopimg"><br><br>
                    价格：<input type="text" name="price"><br><br>
                    数量：<input type="text" name="number"><br><br>
                    类型：<select name="id" id="types">
                        <foreach name="types" item="type">
                              <option id="{$type.idty}" value="{$type.idty}">{$type.leibiename}</option>
                        </foreach>
                        </select>
                    <div class="modal-footer">
                        <button class="btn btn-primary" type="submit">确定</button>
                        <a class="btn btn-default" data-dismiss="modal">取消</a>
                    </div>
                </form>
            </div>
        </div>
        <!--第二中-->
    </div>
</block>

<block name="modal1">
    <div class="modal" id="d2">
        <div class="modal-dialog" style="width:420px;">
            <div class="modal-content">
                <div class="modal-header">
                    <h4>添加折扣商品</h4>
                </div>
                <form action="__URL__/teijia" method="post" class="form-horizontal" enctype="multipart/form-data">
                    商品：<input type="text" name="shopname"><br><br>
                    图片：<input type="file" name="shopimg"><br><br>
                    价格：<input type="text" name="price"><br><br>
                    数量：<input type="text" name="number"><br><br>
                    折扣：<input type="text" name="discount"><br><br>
                    类型：<select name="ids" id="typ">
                        <foreach name="types" item="type">
                              <option value="{$type.idty}">{$type.leibiename}</option>
                        </foreach>
                        </select>
                    <div class="modal-footer">
                        <button class="btn btn-primary" type="submit">确定</button>
                        <a class="btn btn-default" data-dismiss="modal">取消</a>
                    </div>
                </form>
            </div>
        </div>
        <!--第二中-->
    </div>
</block>
<block name="modal2">
    <foreach name="shop" item="shops">
        <div class="modal" id="A{$shops.idit}">
            <div class="modal-dialog" style="width:420px;">
                <div class="modal-content">
                    <div class="modal-header">
                        <h4>修改折扣</h4>
                    </div>
                    <form action="__URL__/xiugai" method="post" class="form-horizontal">
                        <input type="hidden" value="{$shops.idit}" name="id">
                        修改折扣：<input type="text" name="name"><br><br>
                        <div class="modal-footer">
                            <button class="btn btn-primary" type="submit">确定</button>
                            <a class="btn btn-default" data-dismiss="modal">取消</a>
                        </div>
                    </form>
                </div>
            </div>
            <!--第二中-->
        </div>
    </foreach>
</block>

<block name="modal3">
        <div class="modal" id="b4">
            <div class="modal-dialog" style="width:420px;">
                <div class="modal-content">
                    <div class="modal-header">
                        <h4>添加类型</h4>
                    </div>
                    <form action="__URL__/csx" method="post" class="form-horizontal">
                        新类型：<input type="text" name="name"><br><br>
                        <div class="modal-footer">
                            <button class="btn btn-primary" type="submit">确定</button>
                            <a class="btn btn-default" data-dismiss="modal">取消</a>
                        </div>
                    </form>
                </div>
            </div>
            <!--第二中-->
        </div>
</block>

<script>

</script>



